#define _CRT_SECURE_NO_WARNINGS 1
bool isPalindrome(int x) {
    if (x < 0 || (x % 10 == 0 && x != 0))
    {
        return false;
    }
    int tranfer = 0;
    while (tranfer < x)
    {
        tranfer = tranfer * 10 + x % 10;
        x /= 10;
    }

    return x == tranfer || x == tranfer / 10;
}

bool isPalindrome(int x) {
    int a[10];
    if (x < 0)
    {
        return false;
    }
    else if (x < 10)
    {
        return true;
    }
    int i = 0;
    int transfer = 0;
    while (x)
    {
        a[i++] = x % 10;
        x /= 10;
    }
    int m = i;
    int j = 0;
    for (i = 0, j = m - 1; i < j; i++, j--)
    {
        if (a[i] != a[j])
        {
            return false;
        }
    }
    return true;

}